<!--

    Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
    Portions Copyright &#169; [2017-2020] Payara Foundation and/or affiliates.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<p><a id="task-configtransrecovery" name="task-configtransrecovery"></a><a id="GHJTS00005" name="GHJTS00005"></a></p>

<h4><a id="sthref4" name="sthref4"></a>To Configure How the Payara Server Recovers Transactions</h4>
<a name="BEGIN" id="BEGIN"></a>
<p>Transactions might be incomplete either because the server crashed or because a resource manager crashed between phases of a 2-phase commit. It is essential to complete these stranded transactions and recover from the failures. Payara Server is designed to recover from these failures and complete the transactions upon server startup.</p>
<p>Before performing the recovery, make sure all the resources involved are up and running.</p>
<p>When the transaction spans across servers, the server that started the transaction can contact the other servers to get the outcome of the transactions. If the other servers are unreachable, the transaction uses the Heuristic Decision field to determine the outcome.</p>
<ol>
<li>
<p>In the navigation tree, expand the Configuration node.</p>
</li>
<li>
<p>Select the instance to configure:</p>
<ul>
<li>
<p>To configure a particular instance, select the instance's config node. For example, the default instance, <code>server</code>, select the <code>server-config</code> node.</p>
</li>
<li>
<p>To configure the default settings for all instances, select the <code>default-config</code> node.</p>
</li>
</ul>
</li>
<li>
<p>Select the Transaction Service node.</p>
<p>The Transaction Service page opens.</p>
</li>
<li>
<p>On the Transaction Service page, select the On Restart Enabled checkbox to enable the recovery of incomplete transactions.</p>
<p>By default, the Enabled checkbox is not selected.</p>
</li>
<li>
<p>In the Retry Timeout field, type the number of seconds the Payara Server tries to connect to an unreachable server.</p>
<p>The default value is 600 (10 minutes).</p>
</li>
<li>
<p>From the Heuristic Decision drop-down list, select the policy for unreachable servers in a transaction.</p>
<p>Unless there is a good reason to select Commit, leave Heuristic Decision set to Rollback (the default). Committing indeterminate transactions can compromise the data integrity of your application.</p>
</li>
<li>
<p>Click Save.</p>
</li>
<li>
<p>Restart the Payara Server.</p>
</li>
</ol>
<a id="sthref5" name="sthref5"></a>
<h5>See Also</h5>
<ul>
<li>
<p><a href="task-configtransservice.html">To Configure the Transaction Service</a></p>
</li>
<li>
<p><a href="task-settranstimeout.html">To Set a Transaction Timeout Value</a></p>
</li>
<li>
<p><a href="task-settranslog.html">To Set the Location of the Transaction Logs</a></p>
</li>
<li>
<p><a href="task-setkeyptinterval.html">To Set the Keypoint Interval</a></p>
</li>
</ul>


<small>Copyright &#169; 2005, 2017, Oracle and/or its affiliates. All rights reserved. <a href="docinfo.html">Legal Notices</a></small>
<small>Portions Copyright &#169; [2017-2020] Payara Foundation and/or affiliates.</small>
